/*! \file mem_c_profile.cpp
 *	\brief 
 *
 *	created:	2009/11/20
 *	created:	20:11:2009   18:18
 *	filename: 	o:\main\libs\mem\mem_c_profile.cpp
 *	file path:	o:\main\libs\mem
 *	file base:	mem_c_profile
 *	file ext:	cpp
 *	author:		Vitalii Trubchaninov
 *				venngraydog@gmail.com
 */
 
#include "mem/stdafx.h"
#include "mem/mem_c_profile.h"

#if TT_MEM_ENABLED && TT_MEM_PROFILING

#include "mem/impl/provider.h"
#include "mem/impl/routines.h"

namespace gimpl = tt::mem::impl;

extern "C"{

MEM_API void* mem_c_root_section( const char* root_section_name )
{
	return gimpl::g_provider().root_section(root_section_name);
}

MEM_API void mem_c_register_new( void* section, unsigned int size )
{
	gimpl::g_provider().register_new( reinterpret_cast<gimpl::BlockInfo*>(section), size );
}

MEM_API void mem_c_register_delete( void* section, unsigned int size )
{
	gimpl::g_provider().register_delete( reinterpret_cast<gimpl::BlockInfo*>(section), size );
}

MEM_API void* mem_c_new( void* section, unsigned int size )
{
	return gimpl::mgt_new(section, size);
}

// MEM_API unsigned int mem_c_size( void* p )
// {
// 	return gimpl::mgt_size(p);
// }

MEM_API void mem_c_delete( void* p )
{
	gimpl::mgt_delete(p);
}

}; //extern C

#endif //TT_MEM_ENABLED && TT_MEM_PROFILING
